<template>
    <div class="fillcontain">
        <head-top/>
        <el-button
                type="success"
                @click="handleNew"
        >添加管理员账号
        </el-button>
        <div class="table_container">
            <el-table
                    :data="tableData"
                    style="width: 100%"
            >
                <el-table-column
                        label="用户ID"
                        prop="id"
                />
                <el-table-column
                        label="用户名"
                        prop="account"
                />
                <el-table-column
                        label="姓名"
                        prop="name"
                />
                <el-table-column
                        label="电话"
                        prop="phone"
                />
                <el-table-column
                        label="邮箱"
                        prop="email"
                />
                <el-table-column
                        label="状态"
                        prop="status"
                />
                <el-table-column
                        label="操作"
                        width="200"
                >
                    <template slot-scope="scope">
                        <!--
                        <el-button
                                size="mini"
                                type="warning"
                                @click="handleLock(scope.$index, scope.row)"
                        >
                            锁定
                        </el-button>
                        -->
                        <el-button
                                size="mini"
                                type="danger"
                                @click="handleDelete(scope.$index, scope.row)"
                        >
                            删除
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>


            <div class="Pagination">
                <el-pagination
                        :current-page="currentPage"
                        :page-size="20"
                        layout="total, prev, pager, next"
                        :total="tableData.length"
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                />
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "manageAdmin",
        data: function () {
            return {
                currentPage: 1,
                tableData: []
            }
        },
        created() {
            this.initData();
        },
        methods: {
            initData() {
                for (let i = 1; i <= 6; i++) {
                    this.tableData.push({
                        id: i,
                        account: "admin" + i,
                        name: "管理员" + i,
                        phone: "12345678901",
                        email: "test@example.com",
                        status: "正常"
                    });
                }
            }
        }
    }
</script>

<style scoped>

</style>
